package com.hd.appcommon.service;


import okhttp3.RequestBody;
import okhttp3.ResponseBody;
import retrofit2.Call;
import retrofit2.http.*;
import org.springframework.stereotype.Service;
import retrofit2.http.Query;

@Service
public interface HttpService {

    @GET("openapi/query/test")
    Call<ResponseBody> getTest(@Header("zhangmen-signature") String signature,
                               @Header("zhangmen-request-id") String requestId,
                               @Header("zhangmen-access-key-id") String accessKeyId,
                               @Header("zhangmen-timestamp") String timestamp,
                               @Query("param1") String param1, @Query("param2") String param2);

    @GET("openapi/open-records/search")
    Call<ResponseBody> getOpenRecord(@Header("zhangmen-signature") String signature,
                                     @Header("zhangmen-request-id") String requestId,
                                     @Header("zhangmen-access-key-id") String accessKeyId,
                                     @Header("zhangmen-timestamp") String timestamp,
                                     @Query("startTime") String startTime, @Query("endTime") String endTime);


    @GET("openapi/people-characteristics")
    Call<ResponseBody> getFaceCharacter(@Header("zhangmen-signature") String signature,
                                     @Header("zhangmen-request-id") String requestId,
                                     @Header("zhangmen-access-key-id") String accessKeyId,
                                     @Header("zhangmen-timestamp") String timestamp,
                                     @Query("peopleCode") String peopleCode, @Query("characteristicType") Long characteristicType);


    @POST("/openapi/door/open")
    Call<ResponseBody> remoteDoorOpen(@Header("zhangmen-signature") String signature,
                                     @Header("zhangmen-request-id") String requestId,
                                     @Header("zhangmen-access-key-id") String accessKeyId,
                                     @Header("zhangmen-timestamp") String timestamp,
                                     @Body RequestBody requestBody);


    @POST("/openapi/open-right/card/add")
    Call<ResponseBody> openCardRightAdd(@Header("zhangmen-signature") String signature,
                                      @Header("zhangmen-request-id") String requestId,
                                      @Header("zhangmen-access-key-id") String accessKeyId,
                                      @Header("zhangmen-timestamp") String timestamp,
                                      @Body RequestBody requestBody);

    @HTTP(method = "DELETE" ,path = "/openapi/open-right/card/delete", hasBody = true)
    Call<ResponseBody> openCardRightDelete(@Header("zhangmen-signature") String signature,
                                        @Header("zhangmen-request-id") String requestId,
                                        @Header("zhangmen-access-key-id") String accessKeyId,
                                        @Header("zhangmen-timestamp") String timestamp,
                                        @Body RequestBody requestBody);


    @POST("openapi/json/test")
    Call<ResponseBody> postTest(@Header("zhangmen-signature") String signature,
                                @Header("zhangmen-request-id") String requestId,
                                @Header("zhangmen-access-key-id") String accessKeyId,
                                @Header("zhangmen-timestamp") String timestamp,
                                @Body RequestBody requestBody);


//    @GET("openapi/departments")
//    Call<ResponseBody> departments(@Header("zhangmen-signature") String signature,
//                                @Header("zhangmen-request-id") String requestId,
//                                @Header("zhangmen-access-key-id") String accessKeyId,
//                                @Header("zhangmen-timestamp") String timestamp,
//                                @Query("departmentCode") String departmentCode,
//                                @Query("parentDepartmentCode") String parentDepartmentCode,
//                                @Query("type") Integer type,
//                                @Query("versionCode") String versionCode);


    @POST("openapi/door/open")
    Call<ResponseBody> doorOpen(@Header("zhangmen-signature") String signature,
                                @Header("zhangmen-request-id") String requestId,
                                @Header("zhangmen-access-key-id") String accessKeyId,
                                @Header("zhangmen-timestamp") String timestamp,
                                @Body RequestBody requestBody);

    //获取部门版本号
    @GET("openapi/departments/version")
    Call<ResponseBody> departmentsVersion(
            @Header("zhangmen-signature") String signature,
            @Header("zhangmen-request-id") String requestId,
            @Header("zhangmen-access-key-id") String accessKeyId,
            @Header("zhangmen-timestamp") String timestamp
    );

    //批量更新部门信息
    @PUT("openapi/departments")
    Call<ResponseBody> departments(
            @Header("zhangmen-signature") String signature,
            @Header("zhangmen-request-id") String requestId,
            @Header("zhangmen-access-key-id") String accessKeyId,
            @Header("zhangmen-timestamp") String timestamp,
            @Body RequestBody requestBody
    );

    //获取人员信息版本号
    @GET("openapi/people/version")
    Call<ResponseBody> peopleVersion(
            @Header("zhangmen-signature") String signature,
            @Header("zhangmen-request-id") String requestId,
            @Header("zhangmen-access-key-id") String accessKeyId,
            @Header("zhangmen-timestamp") String timestamp
    );

    //批量更新人员信息
    @PUT("openapi/people")
    Call<ResponseBody> people(
            @Header("zhangmen-signature") String signature,
            @Header("zhangmen-request-id") String requestId,
            @Header("zhangmen-access-key-id") String accessKeyId,
            @Header("zhangmen-timestamp") String timestamp,
            @Body RequestBody requestBody
    );

    @POST("/openapi/open-right/card/add")
    Call<ResponseBody> addCard(
            @Header("zhangmen-signature") String signature,
            @Header("zhangmen-request-id") String requestId,
            @Header("zhangmen-access-key-id") String accessKeyId,
            @Header("zhangmen-timestamp") String timestamp,
            @Body RequestBody requestBody);

    @PUT("/openapi/open-rights")
    Call<ResponseBody> openright(
            @Header("zhangmen-signature") String signature,
            @Header("zhangmen-request-id") String requestId,
            @Header("zhangmen-access-key-id") String accessKeyId,
            @Header("zhangmen-timestamp") String timestamp,
            @Body RequestBody requestBody
    );


    @GET("/openapi/doors")
    Call<ResponseBody> door(
            @Header("zhangmen-signature") String signature,
            @Header("zhangmen-request-id") String requestId,
            @Header("zhangmen-access-key-id") String accessKeyId,
            @Header("zhangmen-timestamp") String timestamp
    );

    @GET("/openapi/students")
    Call<ResponseBody> student(
            @Header("zhangmen-signature") String signature,
            @Header("zhangmen-request-id") String requestId,
            @Header("zhangmen-access-key-id") String accessKeyId,
            @Header("zhangmen-timestamp") String timestamp,
            @Query("classNumber") String param1
    );

    @GET("/openapi/doors")
    Call<ResponseBody> getDoor(@Header("zhangmen-signature") String signature,
                               @Header("zhangmen-request-id") String requestId,
                               @Header("zhangmen-access-key-id") String accessKeyId,
                               @Header("zhangmen-timestamp") String timestamp,
                               @Query("doorCode") String doorCode,
                               @Query("buildingCode") String buildingCode,
                               @Query("useType") Integer useType,
                               @Query("floorCode") String floorCode,
                               @Query("workStatus") Integer workStatus,
                               @Query("versionCode") Long versionCode
                               );

    @GET("/openapi/open-rights")
    Call<ResponseBody> getOpenRight(
            @Header("zhangmen-signature") String signature,
            @Header("zhangmen-request-id") String requestId,
            @Header("zhangmen-access-key-id") String accessKeyId,
            @Header("zhangmen-timestamp") String timestamp,
            @Query("peopleCode") String peopleCode,
            @Query("ekeyType") Integer ekeyType,
            @Query("rightIdentify") String rightIdentify,
            @Query("timeType") Integer timeType,
            @Query("doorCode") String doorCode,
            @Query("versionCode") Long versionCode
    );

    @PUT("/openapi/cards")
    Call<ResponseBody> updateCards(@Header("zhangmen-signature") String signature,
                                @Header("zhangmen-request-id") String requestId,
                                @Header("zhangmen-access-key-id") String accessKeyId,
                                @Header("zhangmen-timestamp") String timestamp,
                                @Body RequestBody requestBody);
}
